<form method="POST">
    Όνομα χρήστη  <input type="text" name="username"></br>
    Κωδικός <input type="text" name="password"></br>
    <input type="submit" name="loginbutton" value="Είσοδος">
</form>

<?php
    include_once 'buslibs/users2.php';
    $loginbutton=false;
    
    if(isset($_POST['username'])) $username=$_POST['username'];
    if(isset($_POST['password'])) $password=$_POST['password'];
    if(isset($_POST['loginbutton'])) $loginbutton=$_POST['loginbutton'];
    
    if ($loginbutton)
    {
        $_SESSION['loggedin']=  login($username,$password);
        header('Location: '. $_SERVER['REQUEST_URI']);
    }
        
?>
